<include file="public:header"/>
<div class="toptip">
    <div class="toptit">提示：</div>
    <p>正式使用后删除分类会导致与此分类关联的信息类别丢失，修改不会受影响。</p>
</div>

<div class="toptit">修改职位分类</div>
<form action="{:U('edit')}" method="post" name="FormData">
    <div class="form_main width120">
        <div class="fl">所属分类:</div>
        <div class="fr">
            <div class="select_input_new w400 J_hoverinput J_dropdown J_listitme_parent">
                <span class="J_listitme_text">选择分类</span>
                <div class="dropdowbox_sn J_dropdown_menu">
                    <div class="dropdow_inner_sn">
                        <ul class="nav_box">
                            <li><a class="J_listitme <eq name='info.parentid' value='0'>list_sel</eq>" href="javascript:;" data-code="0">顶级分类</a></li>
                            <volist name="cate[0]" id="parent">
                                <li><a class="J_listitme <eq name='info.parentid' value='$parent.id'>list_sel</eq>" href="javascript:;" data-code="{$parent.id}">{$parent.categoryname}</a></li>
                                <if condition="C('qscms_category_jobs_level') eq 3">
                                    <volist name="cate[$parent['id']]" id="sub">
                                        <li><a class="J_listitme <eq name='info.parentid' value='$sub.id'>list_sel</eq>" href="javascript:;" data-code="{$sub.id}">├─{$sub.categoryname}</a></li>
                                    </volist>
                                </if>
                            </volist>
                        </ul>
                    </div>
                </div>
                <input class="J_listitme_code" name="parentid" id="parentid" type="hidden" value="" />
            </div>
            <!-- <select name="parentid" <eq name='Think.get.edit_content' value='1'>disabled</eq>>
                <option value="0" <eq name='info.parentid' value='0'>selected="selected"</eq>>顶级分类</option>
                <volist name="cate[0]" id="parent">
                    <option value="{$parent.id}" <eq name='info.parentid' value='$parent.id'>selected="selected"</eq>>{$parent.categoryname}</option>
                    <if condition="C('qscms_category_jobs_level') eq 3">
                        <volist name="cate[$parent['id']]" id="sub">
                            <option value="{$sub.id}" <eq name='info.parentid' value='$sub.id'>selected="selected"</eq>>├─{$sub.categoryname}</option>
                        </volist>
                    </if>
                </volist>
            </select> -->
        </div>
        <div class="fl">名称:</div>
        <div class="fr">
            <input name="categoryname" type="text" class="input_text_default middle" maxlength="20" value="{$info.categoryname}"/>
        </div>
        <div class="fl">别名:</div>
        <div class="fr">
            <input name="spell" type="text" class="input_text_default middle" maxlength="100" value="{$info.spell}"/>
            <label class="no-fl-note">(若不填则系统自动生成)</label>
        </div>
        <div class="fl">排序:</div>
        <div class="fr">
            <input name="category_order" type="text" class="input_text_default middle" maxlength="3" value="{$info.category_order}" onkeyup="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))" placeholder="数字越大越靠前，默认是0"/>
            <label class="no-fl-note">(数字越大越靠前)</label>
        </div>
         <div class="fl">薪资待遇:</div>
        <div class="fr modVal">
            <span class="input_wrap">
                <input name="minwage" type="text" class="input_text_default input_val" maxlength="10" value="{$info['jobs_tpl']['minwage']}" style="width: 100px;" onKeyUp="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))"/> 元/月 -
                <input name="maxwage" type="text" class="input_text_default input_val" maxlength="10" value="{$info['jobs_tpl']['maxwage']}" style="width: 100px;" onKeyUp="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))"/> 元/月
            </span>
            <label><input name="negotiable" type="checkbox" id="J_negotiable" value="1" <if condition="$info['jobs_tpl']['negotiable'] eq 1">checked</if>/>面议</label>
        </div>
        <div class="fl">所属部门:</div>
        <div class="fr">
            <input name="department" type="text" class="input_text_default" maxlength="8" value="{$info['jobs_tpl']['department']}"/>
        </div>
        <div class="fl">学历要求:</div>
        <div class="fr">
            <div class="imgradio J_job_education">
                <input name="education" type="hidden" value="{$info['jobs_tpl']['education']|default='0'}">
                <input name="education_cn" id="education_cn" type="hidden" value="{$info.jobs_tpl.education_cn|default='不限'}"/>
                <div class="radio <empty name='info.jobs_tpl.education'>select</empty>" data="0" title="不限">不限</div>
                <volist name="category['QS_education']" id="list">
                    <div class="radio <eq name='info.jobs_tpl.education' value='$key'>select</eq>" data="{$key}" title="{$list}">{$list}</div>
                </volist>
                <div class="clear"></div>
            </div>
        </div>
        <div class="fl">工作经验:</div>
        <div class="fr">
            <div class="imgradio J_job_experience">
                <input name="experience" type="hidden" value="{$info['jobs_tpl']['experience']|default='0'}">
                <input name="experience_cn" id="experience_cn" type="hidden" value="{$info.jobs_tpl.experience_cn|default='不限'}"/>
                <div class="radio <empty name='info.jobs_tpl.experience'>select</empty>" data="0" title="不限">不限</div>
                <volist name="category['QS_experience']" id="list">
                    <div class="radio <eq name='info.jobs_tpl.experience' value='$key'>select</eq>" data="{$key}" title="{$list}">{$list}</div>
                </volist>
                <div class="clear"></div>
            </div>
        </div>
        <div class="fl">年龄要求:</div>
        <div class="fr">
            <input name="minage" type="text" class="input_text_default" maxlength="3" value="{$info['jobs_tpl']['minage']}" style="width: 50px;" onKeyUp="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))"/> 岁 -
            <input name="maxage" type="text" class="input_text_default" maxlength="3" value="{$info['jobs_tpl']['maxage']}" style="width: 50px;" onKeyUp="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))"/> 岁
        </div>
        <div class="fl">招聘人数:</div>
        <div class="fr">
            <input name="amount" type="text" class="input_text_default" maxlength="3" value="{$info['jobs_tpl']['amount']|default='0'}" style="width: 50px;"
                   onKeyUp="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))"/> 人
            &nbsp;&nbsp;<span style="color: #999999;">0表示若干</span>
        </div>
        <div class="fl">职位描述:</div>
        <div class="fr">
            <textarea id="contents" name="contents" class="input_text_default" style="line-height:200%; height:150px;">{$info.jobs_tpl.contents}</textarea>
            <div style="color: #999999; padding-top: 10px;">说明：请详细描述该职位，内容可包括：职位要求，岗位职责等。</div>
        </div>
       <!--  <eq name='Think.get.edit_content' value='1'>
            <div class="fl">职位描述模板:</div>
            <div class="fr">
                <textarea name="content" type="text" class="input_text_default middle" style="height: 60px; line-height: 180%;">{$info.content}</textarea>
            </div>
            <div class="fl">关联分类1:</div>
            <div class="fr link_blue">
                <input name="relation1_cn" id="category_cn" type="text" class="input_text_default middle arrow J_resuletitle_jobs" value="{$info['relation1_cn']|default='请选择关联职位类别'}" readonly="readonly" data-title="请选择关联职位类别" data-multiple="false" data-addjob="true" data-maxnum="0" <if condition="C('qscms_category_jobs_level') gt 2">data-width="667"<else/>data-width="520"</if> data-category="{:C('qscms_category_jobs_level')}"/>
                <input class="J_resultcode_jobs" name="relation1" id="relation1" type="hidden" value="{$info['relation1']}" />
                <a href="javascript:;" class="clear_relation" data-code="relation1">清空</a>
            </div>
            <div class="fl">关联分类2:</div>
            <div class="fr link_blue">
                <input name="relation2_cn" id="category_cn_t" type="text" class="input_text_default middle arrow J_resuletitle_jobs_t" value="{$info['relation2_cn']|default='请选择关联职位类别'}" readonly="readonly" data-title="请选择关联职位类别" data-multiple="false" data-addjob="true" data-maxnum="0" <if condition="C('qscms_category_jobs_level') gt 2">data-width="667"<else/>data-width="520"</if> data-category="{:C('qscms_category_jobs_level')}"/>
                <input class="J_resultcode_jobs_t" name="relation2" id="relation2" type="hidden" value="{$info['relation2']}" />
                <a href="javascript:;" class="clear_relation" data-code="relation2">清空</a>
            </div>
        </eq> -->
        <div class="fl"></div>
        <div class="fr">
            <input name="id" type="hidden" value="{$info.id}" />
            <input type="submit" class="admin_submit" value="保存"/>
            <input type="button" class="admin_submit" value="返回" onClick="window.location='{:U('index')}'"/>
        </div>
        <div class="clear"></div>
    </div>
</form>

</div>
<include file="public:footer"/>
<qscms:load type="category"/>
<script type="text/javascript" src="../public/js/jquery.modal.userselectlayer.js"></script>
<script type="text/javascript" src="__ADMINPUBLIC__/js/jquery.listitem.js"></script>
<script type="text/javascript" src="__ADMINPUBLIC__/js/jquery.dropdown.js"></script>
</body>
<script type="text/javascript">
    $(document).ready(function () {
        $('.clear_relation').click(function(){
            var code = $(this).data('code');
            $('input[name='+code+']').val('');
            $('input[name='+code+'_cn]').val('请选择关联职位类别');
        })
        if ($('.J_listitme.list_sel').length) {
            var $recoverList = $('.J_listitme.list_sel').eq($('.J_listitme.list_sel').length-1);
            var listSelCn = $.trim($recoverList.text());
            var listSelCode = $recoverList.data('code');
            $('.J_listitme.list_sel').closest('.J_listitme_parent').find('.J_listitme_text').text(listSelCn);
            $('.J_listitme.list_sel').closest('.J_listitme_parent').find('.J_listitme_code').val(listSelCode);
        }
        // 学历要求cn
        $(".J_job_education .radio").live('click',function(){
            $("#education_cn").val($(this).attr("title"));
        });
        // 工作经验要求cn
        $(".J_job_experience .radio").live('click',function(){
            $("#experience_cn").val($(this).attr("title"));
        });
        // 薪资面议
        var negotiable = $('#J_negotiable');
        if (negotiable.is(':checked')) {
            negotiable.closest('.modVal').addClass('txt');
            negotiable.closest('.modVal').find('.input_val').val('').prop('disabled', !0);
            negotiable.closest('.modVal').find('.input_wrap').hide();
        }
        // 面议选中后，最低和最高薪资不能编辑
        negotiable.die().live('click', function(event) {
            if ($(this).is(':checked')) {
                $(this).closest('.modVal').addClass('txt');
                $(this).closest('.modVal').find('.input_val').val('').prop('disabled', !0);
                $(this).closest('.modVal').find('.input_wrap').hide();
            } else {
                $(this).closest('.modVal').removeClass('txt');
                $(this).closest('.modVal').find('.input_val').each(function(index, el) {
                    $(this).val($(this).data('title')).prop('disabled', 0);
                });
                $(this).closest('.modVal').find('.input_wrap').show();
            }
        });
    });
</script>
</html>